#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<cstdlib>//rand()
#define rep(i,a,b) for(register int i = (a);i <= (b);++i)
#define per(i,a,b) for(register int i = (a);i >= (b);--i)
typedef long long ll;
typedef unsigned long long ull;
using std::string;using std::cin;using std::cout;
using std::sqrt;
int n,a[1111];

inline bool cmp(int x,int y){return x > y;}

int main(){
    std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //freopen("in.in", "r", stdin);
    cin >> n;
    rep(i,1,n) cin >> a[i];
    std::sort(a+1,a+n+1,cmp);
    rep(i,1,n){
        if(sqrt(a[i]) != int(sqrt(a[i]))){
            cout << a[i] << "\n";
            return 0;
        }
    }
    return 0;
}